<template>
  <div ref="collection">
    <collection-init v-if="collectionFlag" />
    <collection-list v-else />

    <!-- 底部导航栏 -->
    <footer-guide />
  </div>
</template>
<script>
import CollectionInit from '../../components/Collection/CollectionInit.vue';
import FooterGuide from '../../components/FooterGuide/FooterGuide.vue';
import CollectionList from '../../components/Collection/CollectionList.vue';
import { getCollectList } from '../../api';
export default {
  components: { CollectionInit, FooterGuide, CollectionList },
  data() {
    return {
      collectionFlag: false
    }
  },
  created() {
    getCollectList(this.$cookie.get("userId")).then(({data}) => {
      if(data.data.length === 0) {
        this.collectionFlag = true;
      }else {
        this.collectionFlag = false;
      }
    })
  }
};
</script>
<style lang="scss" scoped>

</style>
